home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Utilities
/
Text Processing
/
AlphaLite.6.52
/
Tcl
/
Modes
/
htmlMenu.tcl
< prev
next >
Wrap
Text File
|
1997-03-04
|
58KB
|
1,522 lines
#=============================================================================
#
# htmlMenu.tcl (called from html.tcl)
#
# Part of HTML mode 1.4.1
#
# HTML elements definitions and HTML menu.
#
# Copyright 1996, 1997 by Johan Linde <jl@theophys.kth.se>.
# This software may be used freely, and distributed freely, as long as
# the receiver is not obligated in any way by receiving it.
#
# If you make improvements to this file, please share them!
#
#=============================================================================
#
# Loading of package.
proc htmlLoadPackage {level} {
global htmlPackageToUse
global HTMLmodeVars modifiedModeVars
if {$level != $htmlPackageToUse} {
set HTMLmodeVars(htmlPackageToUse) $level
lappend modifiedModeVars {htmlPackageToUse HTMLmodeVars}
message "Rebuilding HTML menu…"
htmlBuildMenu
htmlUnbindKeys
message "Done."
}
}
proc htmlToggleBrother {} {
global HTMLmodeVars modifiedModeVars
set HTMLmodeVars(useBigBrother) [expr !$HTMLmodeVars(useBigBrother)]
if {[catch {nameFromAppl Bbth}]} {
set HTMLmodeVars(useBigBrother) 0
enableMenuItem {Check Links} {Use Big Brother} off
}
markMenuItem -m {Check Links} {Use Big Brother} $HTMLmodeVars(useBigBrother)
lappend modifiedModeVars {useBigBrother HTMLmodeVars}
}
# Called from HTML menu to change browser.
proc htmlToggleBrowser {brws} {
global htmlBrowsers browserSig modifiedVars
foreach b $htmlBrowsers {
if {$brws == [lindex $b 1]} {set browserSig [lindex $b 0]}
}
lappend modifiedVars browserSig
}
# Called whenever browserSig is changed.
proc htmlToggleBrowser2 {dum1 dum2 dum3} {
global browserSig htmlBrowsers HTMLmodeVars
if {[lsearch -exact $HTMLmodeVars(browsers) $browserSig] < 0} {htmlAddBrowser $browserSig}
foreach b $htmlBrowsers {
if {$browserSig == [lindex $b 0]} {
markMenuItem -m Browsers [lindex $b 1] on
} else {
markMenuItem -m Browsers [lindex $b 1] off
}
}
}
# Add a browser to Browser menu.
proc htmlAddBrowser {{sig ""}} {
global htmlBrowsers HTMLmodeVars modifiedModeVars
if {$sig == ""} {
set fil [getfile "Locate a web browser."]
set sig [getFileSig $fil]
}
if {[catch {nameFromAppl $sig} fil]} {
alertnote "Couldn't get the name of the browser. If nothing else helps try rebuilding the desktop."
return
}
if {[lsearch -exact $HTMLmodeVars(browsers) $sig] >= 0} {return}
lappend HTMLmodeVars(browsers) $sig
lappend modifiedModeVars {browsers HTMLmodeVars}
lappend htmlBrowsers [list $sig [file tail $fil]]
addMenuItem -m Browsers [file tail $fil]
}
# Remove a browser from Browser menu.
proc htmlRemoveBrowser {} {
global htmlBrowsers HTMLmodeVars modifiedModeVars browserSig modifiedVars
foreach b $htmlBrowsers {
lappend tmp [lindex $b 1]
}
if {[catch {listpick -p "Select browser to remove" $tmp} brws] || $brws == ""} {return}
for {set i 0} {$i < [llength $htmlBrowsers]} {incr i} {
if {$brws == [lindex [lindex $htmlBrowsers $i] 1]} {
deleteMenuItem -m Browsers $brws
if {[lindex $HTMLmodeVars(browsers) $i] == $browserSig} {
set j 0
if {$i == 0} {incr j}
if {$j < [llength $HTMLmodeVars(browsers)]} {set browserSig [lindex $HTMLmodeVars(browsers) $j]}
lappend modifiedVars browserSig
}
set htmlBrowsers [lreplace $htmlBrowsers $i $i]
set HTMLmodeVars(browsers) [lreplace $HTMLmodeVars(browsers) $i $i]
}
}
lappend modifiedModeVars {browsers HTMLmodeVars}
}
proc htmlEnableURLs {onoff} {
enableMenuItem URLs "Clean Up…" $onoff
enableMenuItem URLs "Clear" $onoff
enableMenuItem URLs "Export…" $onoff
}
proc htmlEnablewindows {onoff} {
enableMenuItem "HTML Utilities" Windows $onoff
}
proc htmlEnableExtend {a b} {
enableMenuItem Extend "Change Key Binding" $a
enableMenuItem Extend "Change Type and Layout" $a
enableMenuItem Extend "Remove Attributes" $b
enableMenuItem Extend "Remove Additions" $b
}
# This proc is not used any more. It now gives a warning message if the user
# call it to define new elements in HTMLprefs.tcl.
proc htmlNewElemVar {{list ""} {var ""} {val ""}} {
global htmlShownWarning
if {![info exists htmlShownWarning]} {
beep
dialog -w 350 -h 290 -t "The way to add custom elements to HTML mode has changed."\
10 10 340 45 \
-t "New elements can now be added with the functions found in the submenu HTML Utilities\
-> Extend in the HTML menu. However, this submenu is disabled until you remove all\
your definitions of custom elements from HTMLPrefs.tcl and restart Alpha."\
10 55 340 150\
-t "Select 'Help' from the HTML menu and then select 'Extending HTML mode' from the\
marks menu in the help file to read more about how to avoid this message and how\
to add new elements to HTML mode." 10 160 340 250\
-b OK 20 260 85 280
set htmlShownWarning 1
enableMenuItem "HTML Utilities" Extend off
}
}
proc htmlSetAttrUsed {num elem used} {
global htmlElemAttrUsed htmlElemAttrUsed3
if {![info exists htmlElemAttrUsed${num}($elem)]} {set htmlElemAttrUsed${num}($elem) $used}
}
#
# htmlElemAttrRequired: the per-element lists of all required attributes
# htmlElemAttrOptional: the per-element lists of all optional attributes
# htmlElemAttrChoices: element-specific attribute completions
# htmlElemAttrNumber: the per-element list of attributes which are numbers.
# htmlElemEventHandler: the per-element list of JavaScript's event handlers.
# htmlElemAttrUsed: the per-element list of elements asked for in the status bar.
#
# htmlElemAttrOptional has to be defined for every element for everything
# to work.
#=============================================================================
#
# Extensions
#
#=============================================================================
proc htmlExtensions {} {
global htmlElemAttrRequired1 htmlElemAttrOptional1 htmlPlugins
global htmlElemEventHandler1 htmlElemAttrChoices1 htmlElemAttrNumber1
set htmlElemAttrOptional1(HTML) {}
set htmlElemAttrOptional1(HEAD) {}
set htmlElemAttrOptional1(TITLE) {}
set htmlElemAttrOptional1(BODY) {BACKGROUND= BGCOLOR= TEXT= LINK= VLINK= ALINK=}
set htmlElemEventHandler1(BODY) {onLoad= onUnload=}
htmlSetAttrUsed "" BODY {BACKGROUND= BGCOLOR= TEXT= LINK= VLINK=}
set htmlElemAttrOptional1(H1) {ALIGN= }
set htmlElemAttrChoices1(H1) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" H1 {ALIGN=}
set htmlElemAttrOptional1(H2) {ALIGN= }
set htmlElemAttrChoices1(H2) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" H2 {ALIGN=}
set htmlElemAttrOptional1(H3) {ALIGN= }
set htmlElemAttrChoices1(H3) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" H3 {ALIGN=}
set htmlElemAttrOptional1(H4) {ALIGN= }
set htmlElemAttrChoices1(H4) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" H4 {ALIGN=}
set htmlElemAttrOptional1(H5) {ALIGN= }
set htmlElemAttrChoices1(H5) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" H5 {ALIGN=}
set htmlElemAttrOptional1(H6) {ALIGN= }
set htmlElemAttrChoices1(H6) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" H6 {ALIGN=}
set htmlElemAttrOptional1(P) {ALIGN= }
set htmlElemAttrChoices1(P) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" P {ALIGN=}
set htmlElemAttrOptional1(BLOCKQUOTE) {}
set htmlElemAttrOptional1(DIV) {ALIGN= }
set htmlElemAttrChoices1(DIV) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed "" DIV {ALIGN=}
set htmlElemAttrOptional1(ADDRESS) {}
set htmlElemAttrOptional1(CENTER) {}
set htmlElemAttrOptional1(PRE) {WIDTH= }
set htmlElemAttrNumber1(PRE) {WIDTH=1:i:n}
set htmlElemAttrRequired1(MULTICOL) {COLS=}
set htmlElemAttrOptional1(MULTICOL) {GUTTER= WIDTH=}
set htmlElemAttrNumber1(MULTICOL) {COLS=2:i:n GUTTER=0:i:n WIDTH=1:i:%}
htmlSetAttrUsed "" MULTICOL {COLS= GUTTER= WIDTH=}
set htmlElemAttrRequired1(SPACER) {TYPE=}
set htmlElemAttrOptional1(SPACER) {SIZE= WIDTH= HEIGHT= ALIGN=}
set htmlElemAttrNumber1(SPACER) {SIZE=1:i:n WIDTH=1:i:% HEIGHT=1:i:%}
set htmlElemAttrChoices1(SPACER) {TYPE=HORIZONTAL TYPE=VERTICAL TYPE=BLOCK ALIGN=TOP
ALIGN=MIDDLE ALIGN=BOTTOM ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE}
htmlSetAttrUsed "" SPACER {TYPE= SIZE= WIDTH= HEIGHT= ALIGN=}
set htmlElemAttrOptional1(BR) {CLEAR= }
set htmlElemAttrChoices1(BR) {CLEAR=ALL CLEAR=LEFT CLEAR=RIGHT CLEAR=NONE}
set htmlElemAttrOptional1(HR) {ALIGN= SIZE= WIDTH= NOSHADE}
set htmlElemAttrChoices1(HR) {ALIGN=LEFT ALIGN=RIGHT ALIGN=CENTER}
set htmlElemAttrNumber1(HR) {SIZE=1:i:n WIDTH=1:i:%}
set htmlElemAttrOptional1(NOBR) {}
set htmlElemAttrOptional1(WBR) {}
set htmlElemAttrOptional1(FONT) {SIZE= COLOR= FACE=}
set htmlElemAttrNumber1(FONT) {SIZE=1:7:n}
htmlSetAttrUsed "" FONT {SIZE=}
set htmlElemAttrRequired1(BASEFONT) {SIZE=}
set htmlElemAttrOptional1(BASEFONT) {}
set htmlElemAttrNumber1(BASEFONT) {SIZE=1:7:n}
set htmlElemAttrOptional1(B) {}
set htmlElemAttrOptional1(I) {}
set htmlElemAttrOptional1(STRIKE) {}
set htmlElemAttrOptional1(U) {}
set htmlElemAttrOptional1(SUB) {}
set htmlElemAttrOptional1(SUP) {}
set htmlElemAttrOptional1(BIG) {}
set htmlElemAttrOptional1(SMALL) {}
set htmlElemAttrOptional1(EM) {}
set htmlElemAttrOptional1(STRONG) {}
set htmlElemAttrOptional1(DFN) {}
set htmlElemAttrOptional1(CODE) {}
set htmlElemAttrOptional1(VAR) {}
set htmlElemAttrOptional1(CITE) {}
set htmlElemAttrOptional1(KBD) {}
set htmlElemAttrOptional1(TT) {}
set htmlElemAttrOptional1(SAMP) {}
set htmlElemAttrOptional1(BLINK) {}
set htmlElemAttrOptional1(A) {HREF= NAME= TARGET= REL= REV= TITLE= }
set htmlElemEventHandler1(A) {onClick= onMouseOver= onMouseOut=}
htmlSetAttrUsed "" A {HREF= NAME=}
set htmlElemAttrRequired1(IMG) {SRC=}
set htmlElemAttrOptional1(IMG) {LOWSRC= WIDTH= HEIGHT= BORDER=
ALIGN= ALT= HSPACE= VSPACE= USEMAP= ISMAP}
set htmlElemAttrChoices1(IMG) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE}
set htmlElemAttrNumber1(IMG) {BORDER=0:i:n WIDTH=1:i:% HEIGHT=1:i:%
HSPACE=0:i:n VSPACE=0:i:n}
set htmlElemEventHandler1(IMG) {onAbort= onError= onLoad=}
htmlSetAttrUsed "" IMG {SRC= WIDTH= HEIGHT= ALIGN= ALT=}
set htmlElemAttrRequired1(EMBED) {SRC= WIDTH= HEIGHT=}
set htmlElemAttrOptional1(EMBED) {HSPACE= VSPACE= ALIGN=}
set htmlElemAttrNumber1(EMBED) {WIDTH=1:i:n HEIGHT=1:i:n HSPACE=1:i:n VSPACE=1:i:n}
set htmlElemAttrChoices1(EMBED) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE}
set htmlElemAttrOptional1(NOEMBED) {}
set htmlElemAttrRequired1(LIVEAUDIO) {SRC= WIDTH= HEIGHT=}
set htmlElemAttrOptional1(LIVEAUDIO) {HSPACE= VSPACE= ALIGN= AUTOSTART= LOOP=}
set htmlElemAttrNumber1(LIVEAUDIO) {WIDTH=1:i:n HEIGHT=1:i:n HSPACE=1:i:n VSPACE=1:i:n}
set htmlElemAttrChoices1(LIVEAUDIO) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE
AUTOSTART=TRUE AUTOSTART=FALSE LOOP=TRUE LOOP=FALSE}
htmlSetAttrUsed "" LIVEAUDIO {SRC= WIDTH= HEIGHT= AUTOSTART= LOOP=}
set htmlElemAttrRequired1(LIVEVIDEO) {SRC= WIDTH= HEIGHT=}
set htmlElemAttrOptional1(LIVEVIDEO) {HSPACE= VSPACE= ALIGN= AUTOSTART= LOOP= CONTROLS=}
set htmlElemAttrNumber1(LIVEVIDEO) {WIDTH=1:i:n HEIGHT=1:i:n HSPACE=1:i:n VSPACE=1:i:n}
set htmlElemAttrChoices1(LIVEVIDEO) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE
AUTOSTART=TRUE AUTOSTART=FALSE LOOP=TRUE LOOP=FALSE CONTROLS=TRUE CONTROLS=FALSE}
htmlSetAttrUsed "" LIVEVIDEO {SRC= WIDTH= HEIGHT= AUTOSTART= LOOP= CONTROLS=}
set htmlElemAttrRequired1([list QUICKTIME MOVIE]) {SRC= }
set htmlElemAttrOptional1([list QUICKTIME MOVIE]) {WIDTH= HEIGHT= HSPACE= VSPACE= ALIGN=
HIDDEN= AUTOPLAY= CONTROLLER= LOOP= PLAYEVERYFRAME= HREF= TARGET= PLUGINSPAGE=}
set htmlElemAttrNumber1([list QUICKTIME MOVIE]) {WIDTH=1:i:n HEIGHT=1:i:n HSPACE=1:i:n VSPACE=1:i:n}
set htmlElemAttrChoices1([list QUICKTIME MOVIE]) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE HIDDEN=TRUE HIDDEN=FALSE
AUTOPLAY=TRUE AUTOPLAY=FALSE CONTROLLER=TRUE CONTROLLER=FALSE LOOP=TRUE LOOP=FALSE
LOOP=PALINDROME PLAYEVERYFRAME=TRUE PLAYEVERYFRAME=FALSE}
htmlSetAttrUsed "" "QUICKTIME MOVIE" {SRC= WIDTH= HEIGHT= HIDDEN= AUTOPLAY= CONTROLLER= LOOP=
PLAYEVERYFRAME=}
set htmlElemAttrRequired1([list QUICKTIME VR]) {SRC= WIDTH= HEIGHT=}
set htmlElemAttrOptional1([list QUICKTIME VR]) {HSPACE= VSPACE= ALIGN= PAN= TILT= FOV=
NODE= CORRECTION= PLUGINSPAGE=}
set htmlElemAttrNumber1([list QUICKTIME VR]) {WIDTH=1:i:n HEIGHT=1:i:n
HSPACE=1:i:n VSPACE=1:i:n PAN=0:360:n TILT=-360:360:n FOV=-360:360:n NODE=0:i:n}
set htmlElemAttrChoices1([list QUICKTIME VR]) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE
CORRECTION=NONE CORRECTION=PARTIAL CORRECTION=FULL}
htmlSetAttrUsed "" "QUICKTIME VR" {SRC= WIDTH= HEIGHT= PAN= TILT= FOV=
NODE= CORRECTION=}
set htmlElemAttrRequired1(REALAUDIO) {SRC= WIDTH= HEIGHT=}
set htmlElemAttrOptional1(REALAUDIO) {HSPACE= VSPACE= ALIGN= CONTROLS= AUTOSTART=
NOLABELS= CONSOLE=}
set htmlElemAttrNumber1(REALAUDIO) {WIDTH=1:i:n HEIGHT=1:i:n HSPACE=1:i:n VSPACE=1:i:n}
set htmlElemAttrChoices1(REALAUDIO) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE ALIGN=BASELINE
CONTROLS=ALL CONTROLS=CONTROLPANEL CONTROLS=INFOVOLUMEPANEL CONTROLS=INFOPANEL
CONTROLS=STATUSBAR CONTROLS=PLAYBUTTON CONTROLS=STOPBUTTON CONTROLS=VOLUMESLIDER
CONTROLS=POSITIONSLIDER CONTROLS=POSITIONFIELD CONTROLS=STATUSFIELD
AUTOSTART=TRUE AUTOSTART=FALSE NOLABELS=TRUE NOLABELS=FALSE}
htmlSetAttrUsed "" REALAUDIO {SRC= WIDTH= HEIGHT= CONTROLS= AUTOSTART=
NOLABELS= CONSOLE=}
set htmlElemAttrOptional1(UL) {TYPE= COMPACT}
set htmlElemAttrChoices1(UL) {TYPE=DISC TYPE=CIRCLE TYPE=SQUARE}
set htmlElemAttrOptional1([list LI IN UL]) {TYPE=}
set htmlElemAttrChoices1([list LI IN UL]) {TYPE=DISC TYPE=CIRCLE TYPE=SQUARE}
set htmlElemAttrOptional1(OL) {TYPE= START= COMPACT}
set htmlElemAttrChoices1(OL) {TYPE=A TYPE=a TYPE=I TYPE=i TYPE=1}
set htmlElemAttrNumber1(OL) {START=1:i:n}
set htmlElemAttrOptional1([list LI IN OL]) {TYPE= VALUE=}
set htmlElemAttrNumber1([list LI IN OL]) {VALUE=1:i:n}
set htmlElemAttrChoices1([list LI IN OL]) {TYPE=A TYPE=a TYPE=I TYPE=i TYPE=1}
set htmlElemAttrOptional1(DIR) {COMPACT}
set htmlElemAttrOptional1(MENU) {COMPACT}
set htmlElemAttrOptional1(LI) {}
set htmlElemAttrOptional1(DL) {COMPACT}
set htmlElemAttrOptional1(DT) {}
set htmlElemAttrOptional1(DD) {}
set htmlElemAttrOptional1(FORM) {ACTION= METHOD= ENCTYPE= TARGET= NAME=}
set htmlElemAttrChoices1(FORM) {METHOD=POST METHOD=GET}
set htmlElemEventHandler1(FORM) {onReset= onSubmit=}
htmlSetAttrUsed "" FORM {ACTION= METHOD= }
set htmlElemAttrRequired1(TEXT) {NAME=}
set htmlElemAttrOptional1(TEXT) {VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrNumber1(TEXT) {SIZE=1:i:n MAXLENGTH=1:i:n}
set htmlElemEventHandler1(TEXT) {onBlur= onChange= onFocus= onSelect=}
htmlSetAttrUsed "" TEXT {NAME= VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrRequired1(CHECKBOX) {NAME= VALUE=}
set htmlElemAttrOptional1(CHECKBOX) {CHECKED}
set htmlElemEventHandler1(CHECKBOX) {onClick=}
htmlSetAttrUsed "" CHECKBOX {NAME= VALUE= CHECKED}
set htmlElemAttrRequired1(BUTTON) {VALUE=}
set htmlElemAttrOptional1(BUTTON) {NAME=}
set htmlElemEventHandler1(BUTTON) {onClick=}
htmlSetAttrUsed "" BUTTON {VALUE= NAME=}
set htmlElemAttrRequired1(RADIO) {NAME= VALUE=}
set htmlElemAttrOptional1(RADIO) {CHECKED}
set htmlElemEventHandler1(RADIO) {onClick=}
htmlSetAttrUsed "" RADIO {NAME= VALUE= CHECKED}
set htmlElemAttrOptional1(SUBMIT) {NAME= VALUE=}
set htmlElemEventHandler1(SUBMIT) {onClick=}
htmlSetAttrUsed "" SUBMIT {VALUE= }
set htmlElemAttrOptional1(RESET) {VALUE= }
set htmlElemEventHandler1(RESET) {onClick=}
htmlSetAttrUsed "" RESET {VALUE= }
set htmlElemAttrRequired1(PASSWORD) {NAME= }
set htmlElemAttrOptional1(PASSWORD) {VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrNumber1(PASSWORD) {SIZE=1:i:n MAXLENGTH=1:i:n}
htmlSetAttrUsed "" PASSWORD {NAME= VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrRequired1(HIDDEN) {NAME= VALUE=}
set htmlElemAttrOptional1(HIDDEN) {}
set htmlElemAttrRequired1(IMAGE) {NAME= SRC=}
set htmlElemAttrOptional1(IMAGE) {ALIGN=}
set htmlElemAttrChoices1(IMAGE) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT}
set htmlElemAttrRequired1(FILE) {NAME= }
set htmlElemAttrOptional1(FILE) {SIZE= MAXLENGTH=}
set htmlElemAttrNumber1(FILE) {SIZE=1:i:n MAXLENGTH=1:i:n}
set htmlElemAttrRequired1(SELECT) {NAME= }
set htmlElemAttrOptional1(SELECT) {SIZE= MULTIPLE}
set htmlElemAttrNumber1(SELECT) {SIZE=1:i:n}
set htmlElemEventHandler1(SELECT) {onBlur= onChange= onFocus=}
htmlSetAttrUsed "" SELECT {NAME= SIZE= MULTIPLE}
set htmlElemAttrOptional1(OPTION) {VALUE= SELECTED}
htmlSetAttrUsed "" OPTION {SELECTED}
set htmlElemAttrRequired1(TEXTAREA) {NAME= ROWS= COLS=}
set htmlElemAttrOptional1(TEXTAREA) {WRAP=}
set htmlElemAttrNumber1(TEXTAREA) {ROWS=1:i:n COLS=1:i:n}
set htmlElemAttrChoices1(TEXTAREA) {WRAP=VIRTUAL WRAP=PHYSICAL WRAP=OFF}
set htmlElemEventHandler1(TEXTAREA) {onBlur= onChange= onFocus= onSelect=}
set htmlElemAttrOptional1(TABLE) {BORDER= CELLSPACING= CELLPADDING= WIDTH= HEIGHT=
ALIGN= BGCOLOR=}
set htmlElemAttrChoices1(TABLE) {ALIGN=LEFT ALIGN=CENTER ALIGN=RIGHT}
set htmlElemAttrNumber1(TABLE) {BORDER=0:i:n CELLSPACING=0:i:n
CELLPADDING=0:i:n WIDTH=1:i:% HEIGHT=1:i:%}
htmlSetAttrUsed "" TABLE {BORDER= CELLSPACING= CELLPADDING=}
set htmlElemAttrOptional1(TD) {ALIGN= VALIGN= COLSPAN= ROWSPAN= WIDTH= HEIGHT= NOWRAP
BGCOLOR=}
set htmlElemAttrChoices1(TD) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT
VALIGN=BASELINE VALIGN=BOTTOM VALIGN=MIDDLE VALIGN=TOP }
set htmlElemAttrNumber1(TD) {COLSPAN=1:i:n ROWSPAN=1:i:n WIDTH=1:i:% HEIGHT=1:i:n}
htmlSetAttrUsed "" TD {ALIGN= VALIGN= COLSPAN= ROWSPAN= NOWRAP}
set htmlElemAttrOptional1(TH) {ALIGN= VALIGN= COLSPAN= ROWSPAN= WIDTH= HEIGHT= NOWRAP
BGCOLOR=}
set htmlElemAttrChoices1(TH) {ALIGN=LEFT ALIGN=CENTER ALIGN=RIGHT
VALIGN=BASELINE VALIGN=BOTTOM VALIGN=MIDDLE VALIGN=TOP }
set htmlElemAttrNumber1(TH) {COLSPAN=1:i:n ROWSPAN=1:i:n WIDTH=1:i:% HEIGHT=1:i:n}
htmlSetAttrUsed "" TH {ALIGN= VALIGN= COLSPAN= ROWSPAN= NOWRAP }
set htmlElemAttrOptional1(TR) {ALIGN= VALIGN= BGCOLOR=}
set htmlElemAttrChoices1(TR) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT
VALIGN=BASELINE VALIGN=BOTTOM VALIGN=MIDDLE VALIGN=TOP }
htmlSetAttrUsed "" TR {ALIGN= VALIGN=}
set htmlElemAttrOptional1(CAPTION) {ALIGN=}
set htmlElemAttrChoices1(CAPTION) {ALIGN=BOTTOM ALIGN=TOP }
htmlSetAttrUsed "" CAPTION {ALIGN=}
set htmlElemAttrOptional1(FRAMESET) {ROWS= COLS= FRAMEBORDER= BORDER= BORDERCOLOR=}
set htmlElemAttrNumber1(FRAMESET) {BORDER=0:i:n}
set htmlElemAttrChoices1(FRAMESET) {FRAMEBORDER=YES FRAMEBORDER=NO}
set htmlElemEventHandler1(FRAMESET) {onLoad= onUnload=}
htmlSetAttrUsed "" FRAMESET {ROWS= COLS=}
set htmlElemAttrRequired1(FRAME) {SRC=}
set htmlElemAttrOptional1(FRAME) {NAME= MARGINWIDTH= MARGINHEIGHT= SCROLLING=
NORESIZE FRAMEBORDER= BORDERCOLOR=}
set htmlElemAttrChoices1(FRAME) {SCROLLING=YES SCROLLING=NO SCROLLING=AUTO
FRAMEBORDER=YES FRAMEBORDER=NO}
set htmlElemAttrNumber1(FRAME) {MARGINWIDTH=1:i:n MARGINHEIGHT=1:i:n}
htmlSetAttrUsed "" FRAME {SRC= NAME= }
set htmlElemAttrOptional1(NOFRAMES) {}
set htmlElemAttrRequired1(MAP) {NAME=}
set htmlElemAttrOptional1(MAP) {}
set htmlElemAttrRequired1(AREA) {ALT=}
set htmlElemAttrOptional1(AREA) {SHAPE= COORDS= TARGET= HREF= NOHREF}
set htmlElemAttrChoices1(AREA) {SHAPE=RECT SHAPE=CIRCLE SHAPE=POLY
SHAPE=DEFAULT}
set htmlElemEventHandler1(AREA) {onClick= onMouseOver= onMouseOut=}
htmlSetAttrUsed "" AREA {SHAPE= COORDS= HREF= NOHREF}
set htmlElemAttrRequired1(APPLET) {CODE= WIDTH= HEIGHT=}
set htmlElemAttrOptional1(APPLET) {CODEBASE= ARCHIVE= HSPACE= VSPACE= ALIGN= NAME= ALT=
MAYSCRIPT}
set htmlElemAttrChoices1(APPLET) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT ALIGN=TEXTTOP ALIGN=ABSMIDDLE
ALIGN=BASELINE}
set htmlElemAttrNumber1(APPLET) {VSPACE=0:i:n HSPACE=0:i:n WIDTH=1:i:n
HEIGHT=1:i:n}
htmlSetAttrUsed "" APPLET {CODE= WIDTH= HEIGHT= CODEBASE= ALIGN= }
set htmlElemAttrRequired1(PARAM) {NAME= VALUE=}
set htmlElemAttrOptional1(PARAM) {}
set htmlElemAttrOptional1(SCRIPT) {LANGUAGE= SRC=}
set htmlElemAttrChoices1(SCRIPT) {LANGUAGE=JAVASCRIPT}
htmlSetAttrUsed "" SCRIPT {LANGUAGE=}
set htmlElemAttrOptional1(NOSCRIPT) {}
set htmlElemAttrOptional1(BASE) {HREF= TARGET=}
htmlSetAttrUsed "" BASE {HREF= }
set htmlElemAttrOptional1(ISINDEX) {ACTION= PROMPT=}
set htmlElemAttrOptional1(LINK) {HREF= REL= REV= TITLE=}
htmlSetAttrUsed "" LINK {HREF=}
set htmlElemAttrRequired1(META) {CONTENT=}
set htmlElemAttrOptional1(META) {NAME= HTTP-EQUIV=}
}
#=============================================================================
#
# HTML 3.2
#
#=============================================================================
proc html32 {} {
global htmlElemAttrRequired3 htmlElemAttrOptional3
global htmlElemAttrChoices3 htmlElemAttrNumber3
set htmlElemAttrOptional3(HTML) {}
set htmlElemAttrOptional3(HEAD) {}
set htmlElemAttrOptional3(TITLE) {}
set htmlElemAttrOptional3(BODY) {BACKGROUND= BGCOLOR= TEXT= LINK= VLINK= ALINK=}
htmlSetAttrUsed 3 BODY {BACKGROUND= BGCOLOR= TEXT= LINK= VLINK=}
set htmlElemAttrOptional3(H1) {ALIGN= }
set htmlElemAttrChoices3(H1) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 H1 {ALIGN=}
set htmlElemAttrOptional3(H2) {ALIGN= }
set htmlElemAttrChoices3(H2) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 H2 {ALIGN=}
set htmlElemAttrOptional3(H3) {ALIGN= }
set htmlElemAttrChoices3(H3) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 H3 {ALIGN=}
set htmlElemAttrOptional3(H4) {ALIGN= }
set htmlElemAttrChoices3(H4) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 H4 {ALIGN=}
set htmlElemAttrOptional3(H5) {ALIGN= }
set htmlElemAttrChoices3(H5) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 H5 {ALIGN=}
set htmlElemAttrOptional3(H6) {ALIGN= }
set htmlElemAttrChoices3(H6) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 H6 {ALIGN=}
set htmlElemAttrOptional3(P) {ALIGN= }
set htmlElemAttrChoices3(P) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 P {ALIGN=}
set htmlElemAttrOptional3(BLOCKQUOTE) {}
set htmlElemAttrOptional3(DIV) {ALIGN= }
set htmlElemAttrChoices3(DIV) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT}
htmlSetAttrUsed 3 DIV {ALIGN=}
set htmlElemAttrOptional3(ADDRESS) {}
set htmlElemAttrOptional3(CENTER) {}
set htmlElemAttrOptional3(PRE) {WIDTH= }
set htmlElemAttrNumber3(PRE) {WIDTH=1:i:n}
set htmlElemAttrOptional3(BR) {CLEAR= }
set htmlElemAttrChoices3(BR) {CLEAR=ALL CLEAR=LEFT CLEAR=RIGHT CLEAR=NONE}
set htmlElemAttrOptional3(HR) {ALIGN= SIZE= WIDTH= NOSHADE}
set htmlElemAttrChoices3(HR) {ALIGN=LEFT ALIGN=RIGHT ALIGN=CENTER}
set htmlElemAttrNumber3(HR) {SIZE=1:i:n WIDTH=1:i:%}
set htmlElemAttrOptional3(FONT) {SIZE= COLOR=}
set htmlElemAttrNumber3(FONT) {SIZE=1:7:n}
htmlSetAttrUsed 3 FONT {SIZE=}
set htmlElemAttrRequired3(BASEFONT) {SIZE=}
set htmlElemAttrOptional3(BASEFONT) {}
set htmlElemAttrNumber3(BASEFONT) {SIZE=1:7:n}
set htmlElemAttrOptional3(B) {}
set htmlElemAttrOptional3(I) {}
set htmlElemAttrOptional3(STRIKE) {}
set htmlElemAttrOptional3(U) {}
set htmlElemAttrOptional3(SUB) {}
set htmlElemAttrOptional3(SUP) {}
set htmlElemAttrOptional3(BIG) {}
set htmlElemAttrOptional3(SMALL) {}
set htmlElemAttrOptional3(EM) {}
set htmlElemAttrOptional3(STRONG) {}
set htmlElemAttrOptional3(DFN) {}
set htmlElemAttrOptional3(CODE) {}
set htmlElemAttrOptional3(VAR) {}
set htmlElemAttrOptional3(CITE) {}
set htmlElemAttrOptional3(KBD) {}
set htmlElemAttrOptional3(TT) {}
set htmlElemAttrOptional3(SAMP) {}
set htmlElemAttrOptional3(A) {HREF= NAME= REL= REV= TITLE= }
htmlSetAttrUsed 3 A {HREF= NAME=}
set htmlElemAttrRequired3(IMG) {SRC=}
set htmlElemAttrOptional3(IMG) {WIDTH= HEIGHT= BORDER=
ALIGN= ALT= HSPACE= VSPACE= USEMAP= ISMAP}
set htmlElemAttrChoices3(IMG) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT}
set htmlElemAttrNumber3(IMG) {BORDER=0:i:n WIDTH=1:i:n HEIGHT=1:i:n
HSPACE=0:i:n VSPACE=0:i:n}
htmlSetAttrUsed 3 IMG {SRC= WIDTH= HEIGHT= ALIGN= ALT=}
set htmlElemAttrOptional3(UL) {TYPE= COMPACT}
set htmlElemAttrChoices3(UL) {TYPE=DISC TYPE=CIRCLE TYPE=SQUARE}
set htmlElemAttrOptional3([list LI IN UL]) {TYPE=}
set htmlElemAttrChoices3([list LI IN UL]) {TYPE=DISC TYPE=CIRCLE TYPE=SQUARE}
set htmlElemAttrOptional3(OL) {TYPE= START= COMPACT}
set htmlElemAttrChoices3(OL) {TYPE=A TYPE=a TYPE=I TYPE=i TYPE=1}
set htmlElemAttrNumber3(OL) {START=1:i:n}
set htmlElemAttrOptional3([list LI IN OL]) {TYPE= VALUE=}
set htmlElemAttrNumber3([list LI IN OL]) {VALUE=1:i:n}
set htmlElemAttrChoices3([list LI IN OL]) {TYPE=A TYPE=a TYPE=I TYPE=i TYPE=1}
set htmlElemAttrOptional3(DIR) {COMPACT}
set htmlElemAttrOptional3(MENU) {COMPACT}
set htmlElemAttrOptional3(LI) {}
set htmlElemAttrOptional3(DL) {COMPACT}
set htmlElemAttrOptional3(DT) {}
set htmlElemAttrOptional3(DD) {}
set htmlElemAttrOptional3(FORM) {ACTION= METHOD= ENCTYPE= }
set htmlElemAttrChoices3(FORM) {METHOD=POST METHOD=GET}
htmlSetAttrUsed 3 FORM {ACTION= METHOD= }
set htmlElemAttrRequired3(TEXT) {NAME=}
set htmlElemAttrOptional3(TEXT) {VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrNumber3(TEXT) {SIZE=1:i:n MAXLENGTH=1:i:n}
htmlSetAttrUsed 3 TEXT {NAME= VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrRequired3(CHECKBOX) {NAME= VALUE=}
set htmlElemAttrOptional3(CHECKBOX) {CHECKED}
htmlSetAttrUsed 3 CHECKBOX {NAME= VALUE= CHECKED}
set htmlElemAttrRequired3(RADIO) {NAME= VALUE=}
set htmlElemAttrOptional3(RADIO) {CHECKED}
htmlSetAttrUsed 3 RADIO {NAME= VALUE= CHECKED}
set htmlElemAttrOptional3(SUBMIT) {NAME= VALUE=}
htmlSetAttrUsed 3 SUBMIT {VALUE= }
set htmlElemAttrOptional3(RESET) {VALUE= }
htmlSetAttrUsed 3 RESET {VALUE= }
set htmlElemAttrRequired3(PASSWORD) {NAME= }
set htmlElemAttrOptional3(PASSWORD) {VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrNumber3(PASSWORD) {SIZE=1:i:n MAXLENGTH=1:i:n}
htmlSetAttrUsed 3 PASSWORD {NAME= VALUE= SIZE= MAXLENGTH=}
set htmlElemAttrRequired3(HIDDEN) {NAME= VALUE=}
set htmlElemAttrOptional3(HIDDEN) {}
set htmlElemAttrRequired3(IMAGE) {NAME= SRC=}
set htmlElemAttrOptional3(IMAGE) {ALIGN=}
set htmlElemAttrChoices3(IMAGE) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT}
set htmlElemAttrRequired3(FILE) {NAME= }
set htmlElemAttrOptional3(FILE) {SIZE= MAXLENGTH=}
set htmlElemAttrNumber3(FILE) {SIZE=1:i:n MAXLENGTH=1:i:n}
set htmlElemAttrRequired3(SELECT) {NAME= }
set htmlElemAttrOptional3(SELECT) {SIZE= MULTIPLE}
set htmlElemAttrNumber3(SELECT) {SIZE=1:i:n}
htmlSetAttrUsed 3 SELECT {NAME= SIZE= MULTIPLE}
set htmlElemAttrOptional3(OPTION) {VALUE= SELECTED}
htmlSetAttrUsed 3 OPTION {SELECTED}
set htmlElemAttrRequired3(TEXTAREA) {NAME= ROWS= COLS=}
set htmlElemAttrOptional3(TEXTAREA) {}
set htmlElemAttrNumber3(TEXTAREA) {ROWS=1:i:n COLS=1:i:n}
set htmlElemAttrOptional3(TABLE) {BORDER= CELLSPACING= CELLPADDING= WIDTH=
ALIGN=}
set htmlElemAttrChoices3(TABLE) {ALIGN=LEFT ALIGN=CENTER ALIGN=RIGHT}
set htmlElemAttrNumber3(TABLE) {BORDER=0:i:n CELLSPACING=0:i:n
CELLPADDING=0:i:n WIDTH=1:i:%}
htmlSetAttrUsed 3 TABLE {BORDER= CELLSPACING= CELLPADDING=}
set htmlElemAttrOptional3(TD) {ALIGN= VALIGN= COLSPAN= ROWSPAN= WIDTH= HEIGHT= NOWRAP}
set htmlElemAttrChoices3(TD) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT
VALIGN=BOTTOM VALIGN=MIDDLE VALIGN=TOP }
set htmlElemAttrNumber3(TD) {COLSPAN=1:i:n ROWSPAN=1:i:n WIDTH=1:i:n HEIGHT=1:i:n}
htmlSetAttrUsed 3 TD {ALIGN= VALIGN= COLSPAN= ROWSPAN= NOWRAP}
set htmlElemAttrOptional3(TH) {ALIGN= VALIGN= COLSPAN= ROWSPAN= WIDTH= HEIGHT= NOWRAP}
set htmlElemAttrChoices3(TH) {ALIGN=LEFT ALIGN=CENTER ALIGN=RIGHT
VALIGN=BOTTOM VALIGN=MIDDLE VALIGN=TOP }
set htmlElemAttrNumber3(TH) {COLSPAN=1:i:n ROWSPAN=1:i:n WIDTH=1:i:n HEIGHT=1:i:n}
htmlSetAttrUsed 3 TH {ALIGN= VALIGN= COLSPAN= ROWSPAN= NOWRAP }
set htmlElemAttrOptional3(TR) {ALIGN= VALIGN= }
set htmlElemAttrChoices3(TR) {ALIGN=CENTER ALIGN=RIGHT ALIGN=LEFT
VALIGN=BOTTOM VALIGN=MIDDLE VALIGN=TOP }
htmlSetAttrUsed 3 TR {ALIGN= VALIGN=}
set htmlElemAttrOptional3(CAPTION) {ALIGN=}
set htmlElemAttrChoices3(CAPTION) {ALIGN=BOTTOM ALIGN=TOP }
htmlSetAttrUsed 3 CAPTION {ALIGN=}
set htmlElemAttrRequired3(MAP) {NAME=}
set htmlElemAttrOptional3(MAP) {}
set htmlElemAttrRequired3(AREA) {COORDS= ALT=}
set htmlElemAttrOptional3(AREA) {SHAPE= HREF= NOHREF}
set htmlElemAttrChoices3(AREA) {SHAPE=RECT SHAPE=CIRCLE SHAPE=POLY}
htmlSetAttrUsed 3 AREA {SHAPE= COORDS= HREF= NOHREF}
set htmlElemAttrRequired3(APPLET) {CODE= WIDTH= HEIGHT=}
set htmlElemAttrOptional3(APPLET) {CODEBASE= HSPACE= VSPACE= ALIGN= NAME= ALT=}
set htmlElemAttrChoices3(APPLET) {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM
ALIGN=LEFT ALIGN=RIGHT}
set htmlElemAttrNumber3(APPLET) {VSPACE=0:i:n HSPACE=0:i:n WIDTH=1:i:n
HEIGHT=1:i:n}
htmlSetAttrUsed 3 APPLET {CODE= WIDTH= HEIGHT= CODEBASE= ALIGN= }
set htmlElemAttrRequired3(PARAM) {NAME= VALUE=}
set htmlElemAttrOptional3(PARAM) {}
set htmlElemAttrRequired3(BASE) {HREF= }
set htmlElemAttrOptional3(BASE) {}
set htmlElemAttrOptional3(ISINDEX) {PROMPT=}
set htmlElemAttrOptional3(LINK) {HREF= REL= REV= TITLE=}
htmlSetAttrUsed 3 LINK {HREF=}
set htmlElemAttrRequired3(META) {CONTENT=}
set htmlElemAttrOptional3(META) {NAME= HTTP-EQUIV=}
}
#
# Character entities
#
proc htmlNewCharVar {var val} {
global htmlSpecialCharacter
global htmlCharacterSpecial
set htmlSpecialCharacter($var) $val
set htmlCharacterSpecial($val) $var
}
proc htmlNewCapCharVar {var men val} {
global htmlSpecialCapCharacter
global htmlCapCharacterSpecial
global htmlCapCharSpecMenu
set htmlSpecialCapCharacter($var) $val
set htmlCapCharacterSpecial($val) $var
set htmlCapCharSpecMenu($men) $val
}
htmlNewCharVar "ß" szlig
htmlNewCharVar "à" agrave
htmlNewCharVar "á" aacute
htmlNewCharVar "â" acirc
htmlNewCharVar "ã" atilde
htmlNewCharVar "ä" auml
htmlNewCharVar "å" aring
htmlNewCharVar "æ" aelig
htmlNewCharVar "ç" ccedil
htmlNewCharVar "è" egrave
htmlNewCharVar "é" eacute
htmlNewCharVar "ê" ecirc
htmlNewCharVar "ë" euml
htmlNewCharVar "ì" igrave
htmlNewCharVar "í" iacute
htmlNewCharVar "î" icirc
htmlNewCharVar "ï" iuml
htmlNewCharVar "eth" eth
htmlNewCharVar "ñ" ntilde
htmlNewCharVar "ò" ograve
htmlNewCharVar "ó" oacute
htmlNewCharVar "ô" ocirc
htmlNewCharVar "õ" otilde
htmlNewCharVar "ö" ouml
htmlNewCharVar "ø" oslash
htmlNewCharVar "ù" ugrave
htmlNewCharVar "ú" uacute
htmlNewCharVar "û" ucirc
htmlNewCharVar "ü" uuml
htmlNewCharVar "y´" yacute
htmlNewCharVar "thorn" thorn
htmlNewCharVar "ÿ" yuml
htmlNewCapCharVar "À" "À" Agrave
htmlNewCapCharVar "Á" "A´" Aacute
htmlNewCapCharVar "Â" "A^" Acirc
htmlNewCapCharVar "Ã" "Ã" Atilde
htmlNewCapCharVar "Ä" "Ä" Auml
htmlNewCapCharVar "Å" "Å" Aring
htmlNewCapCharVar "Æ" "Æ" Aelig
htmlNewCapCharVar "Ç" "Ç" Ccedil
htmlNewCapCharVar "È" "E`" Egrave
htmlNewCapCharVar "É" "É" Eacute
htmlNewCapCharVar "Ê" "E^" Ecirc
htmlNewCapCharVar "Ë" "E¨" Euml
htmlNewCapCharVar "Ì" "I`" Igrave
htmlNewCapCharVar "Í" "I´" Iacute
htmlNewCapCharVar "Î" "I^" Icirc
htmlNewCapCharVar "Ï" "I¨" Iuml
htmlNewCapCharVar "ETH" "ETH" ETH
htmlNewCapCharVar "Ñ" "Ñ" Ntilde
htmlNewCapCharVar "Ò" "O`" Ograve
htmlNewCapCharVar "Ó" "O´" Oacute
htmlNewCapCharVar "Ô" "O^" Ocirc
htmlNewCapCharVar "Õ" "Õ" Otilde
htmlNewCapCharVar "Ö" "Ö" Ouml
htmlNewCapCharVar "Ø" "Ø" Oslash
htmlNewCapCharVar "Ù" "U`" Ugrave
htmlNewCapCharVar "Ú" "U´" Uacute
htmlNewCapCharVar "Û" "U^" Ucirc
htmlNewCapCharVar "Ü" "Ü" Uuml
htmlNewCapCharVar "Y´" "Y´" Yacute
htmlNewCapCharVar "THORN" "THORN" THORN
set htmlSpecialSymbCharacter(\") quot
set htmlSpecialSymbCharacter(ampersand) amp
set htmlSpecialSymbCharacter([list less than]) lt
set htmlSpecialSymbCharacter([list greater than]) gt
set htmlSpecialSymbCharacter([list nonbreak space]) nbsp
set htmlSpecialSymbCharacter(¡) "#161"
set htmlSpecialSymbCharacter(¢) "#162"
set htmlSpecialSymbCharacter(£) "#163"
set htmlSpecialSymbCharacter(currency) "#164"
set htmlSpecialSymbCharacter(¥) "#165"
set htmlSpecialSymbCharacter(§) "#167"
set htmlSpecialSymbCharacter(©) copy
set htmlSpecialSymbCharacter(ª) "#170"
set htmlSpecialSymbCharacter(«) "#171"
set htmlSpecialSymbCharacter(®) reg
set htmlSpecialSymbCharacter(°) "#176"
set htmlSpecialSymbCharacter(±) "#177"
set htmlSpecialSymbCharacter(µ) "#181"
set htmlSpecialSymbCharacter(¶) "#182"
set htmlSpecialSymbCharacter(middot) "#183"
set htmlSpecialSymbCharacter(º) "#186"
set htmlSpecialSymbCharacter(») "#187"
set htmlSpecialSymbCharacter([list a quarter]) "#188"
set htmlSpecialSymbCharacter([list a half]) "#189"
set htmlSpecialSymbCharacter([list three quarters]) "#190"
set htmlSpecialSymbCharacter(¿) "#191"
set htmlSpecialSymbCharacter(times) "#215"
set htmlSpecialSymbCharacter(÷) "#247"
#
# Colors for background, text and links
#
proc htmlNewColor {var val } {
global htmlColorName
global htmlColorNumber
set htmlColorName($var) $val
set htmlColorNumber($val) $var
}
htmlNewColor black "#000000"
htmlNewColor silver "#C0C0C0"
htmlNewColor gray "#808080"
htmlNewColor white "#FFFFFF"
htmlNewColor maroon "#800000"
htmlNewColor red "#FF0000"
htmlNewColor purple "#800080"
htmlNewColor fuchsia "#FF00FF"
htmlNewColor green "#008000"
htmlNewColor lime "#00FF00"
htmlNewColor olive "#808000"
htmlNewColor yellow "#FFFF00"
htmlNewColor navy "#000080"
htmlNewColor blue "#0000FF"
htmlNewColor teal "#008080"
htmlNewColor aqua "#00FFFF"
# Remove colors conflicting with the new ones
foreach tmpCol [array names htmluserColors] {
if {[info exists htmlColorName($tmpCol)]} {
htmlColordelete $tmpCol $htmluserColors($tmpCol)
}
}
foreach tmpCol [array names htmluserColorname] {
if {[info exists htmlColorNumber($tmpCol)]} {
htmlColordelete $htmluserColorname($tmpCol) $tmpCol
}
}
catch {unset tmpCol}
# A list of colours
set basicColors [lsort [array names htmlColorName]]
rename htmlNewCharVar ""
rename htmlNewCapCharVar ""
rename htmlNewColor ""
#===============================================================================
# Menu Processing
#===============================================================================
proc htmlMenuItem {menu item} {
global htmlMenu HOME htmlElemProc
switch -glob $menu {
"•*" {
switch $item {
"New Document" {htmlNewTemplate BODY}
"Palette" { float -m $htmlMenu -n HTML -z HTML }
"Help" {edit -r -c "$HOME:Help:HTML Help"}
"Manual" {htmlManual}
}
}
"Browsers" {
switch $item {
"Send File to Browser" {htmlSendWindow}
"Add" {htmlAddBrowser}
"Remove" {htmlRemoveBrowser}
default {htmlToggleBrowser $item}
}
}
"Packages" {
switch $item {
"HTML 3.2" {htmlLoadPackage 3}
"Extensions" {htmlLoadPackage 1}
}
}
"HTML Utilities" {
switch $item {
"Colors" {htmlColors}
"Footers" {htmlFooters}
"Home Pages" {htmlHomePages}
"Move Files" {htmlMoveFiles}
"Last Modified" {htmlInsertLastMod}
}
}
"Editing" {
switch $item {
"Select Container" {htmlBalance 0}
"Select in Container" {htmlBalance 1}
"Select Opening" {htmlSelectOpening 0}
"Untag" {htmlUnTag 0}
"Untag and Select" {htmlUnTag 1}
"Remove Opening" {htmlSelectOpening 1}
"Change Container" {htmlChangeContainer}
"Change Opening" {htmlChangeOpening}
"Change Choice" {htmlChangeChoice}
"Reveal Color" {htmlRevealColor}
"Remove Marks" {htmlTabDeleteAll}
}
}
"Character Translation" {
switch $item {
"åäö -> HTML" {htmlCharacterstohtml 0}
"HTML -> åäö" {htmltoCharacters 0}
"<>& -> HTML" {htmlCharacterstohtml 1}
"HTML -> <>&" {htmltoCharacters 1}
}
}
"URLs" {
switch $item {
"Clean Up" {htmlCleanUpCache URLs}
"Clear" {htmlClearCache URLs}
"Import" {htmlImportURL}
"Export" {htmlExportURL}
"Add Folder" {htmlFolderToURL}
"Add Selection" {htmlSelToURL}
"Add Clipboard" {htmlScrapToURL}
}
}
"Windows" {
switch $item {
"Clean Up" {htmlCleanUpCache windows}
"Clear" {htmlClearCache windows}
}
}
"Check Links" {
switch $item {
"Use Big Brother" {htmlToggleBrother}
default {htmlCheckLinks [lindex $item 1]}
}
}
"Includes" {
switch $item {
"Insert Include Tags" {htmlNewInclude}
default {htmlUpdateInclude [lindex $item 1]}
}
}
"Extend" {
switch $item {
"New Element" {htmlCustomNewElem}
"New Attributes" {htmlCustomNewAttr}
"New Choices" {htmlCustomNewChoice}
"Change Key Binding" {htmlCustomChangeKey}
"Change Type and Layout" {htmlCustomChangeType}
"Remove Attributes" {htmlCustomRemoveAttrs}
"Remove Additions" {htmlCustomRemove}
}
}
"Use Attributes" {
htmlUseAttrs $item
}
"Headers" {
switch $item {
"Header1" {htmlBuildCRElem H1 1}
"H1 no attr" {htmlBuildCRElem H1 1 NOATTR}
"Header2" {htmlBuildCRElem H2 1}
"H2 no attr" {htmlBuildCRElem H2 1 NOATTR}
"Header3" {htmlBuildCRElem H3 1}
"H3 no attr" {htmlBuildCRElem H3 1 NOATTR}
"Header4" {htmlBuildCRElem H4 1}
"H4 no attr" {htmlBuildCRElem H4 1 NOATTR}
"Header5" {htmlBuildCRElem H5 1}
"H5 no attr" {htmlBuildCRElem H5 1 NOATTR}
"Header6" {htmlBuildCRElem H6 1}
"H6 no attr" {htmlBuildCRElem H6 1 NOATTR}
}
}
"Blocks and Dividers" {
switch $item {
"Insert Line Breaks" {htmlInsertLineBreaks}
"Remove Line Breaks" {htmlRemoveLineBreaks}
"Insert Paragraphs" {htmlInsertParagraphs}
"Paragraph" {htmlElemParagraph}
"P no attr" {htmlElemParagraph NOATTR}
"Division" {htmlBuildCR2Elem DIV}
"DIV no attr" {htmlBuildCR2Elem DIV NOATTR}
"Block Quote" {htmlBuildCR2Elem BLOCKQUOTE}
"Address" {htmlBuildCRElem ADDRESS}
"Center" {htmlBuildCR2Elem CENTER}
"Preformatted" {htmlBuildCR2Elem PRE}
"Multi Column" {htmlBuildCR2Elem MULTICOL}
"Spacing" {htmlBuildOpening SPACER}
"Line Break" {htmlBuildOpening BR 0 1}
"BR no attr" {htmlBuildOpening BR 0 1 NOATTR}
"Horizontal Rule" {htmlBuildOpening HR 1 1}
"HR no attr" {htmlBuildOpening HR 1 1 NOATTR}
"No Line Break" {htmlBuildElem NOBR}
"Word Break" {htmlBuildOpening WBR 0 1}
}
}
"Styles" {
switch $item {
"Font" {htmlBuildElem FONT}
"Basefont" {htmlBuildOpening BASEFONT 1 1}
"Bold" {htmlBuildElem B}
"Italic" {htmlBuildElem I}
"Strike out" {htmlBuildElem STRIKE}
"Underlined" {htmlBuildElem U}
"Subscript" {htmlBuildElem SUB}
"Superscript" {htmlBuildElem SUP}
"Bigger" {htmlBuildElem BIG}
"Smaller" {htmlBuildElem SMALL}
"Emphasis" {htmlBuildElem EM}
"Strong" {htmlBuildElem STRONG}
"Definition" {htmlBuildElem DFN}
"Code" {htmlBuildElem CODE}
"Variable" {htmlBuildElem VAR}
"Citation" {htmlBuildElem CITE}
"Keyboard" {htmlBuildElem KBD}
"Typewriter" {htmlBuildElem TT}
"Sample" {htmlBuildElem SAMP}
"Blinking" {htmlBuildElem BLINK}
}
}
"Links" {
switch $item {
"Link or Anchor" {htmlBuildElem A}
"Image" {htmlBuildOpening IMG}
}
}
"Plug-ins" {
switch $item {
"General" {htmlBuildOpening EMBED}
"LiveAudio" {htmlBuildOpening EMBED 0 0 LIVEAUDIO}
"LiveVideo" {htmlBuildOpening EMBED 0 0 LIVEVIDEO}
"QuickTime Movie" {htmlBuildOpening EMBED 0 0 "QUICKTIME MOVIE"}
"QuickTime VR" {htmlBuildOpening EMBED 0 0 "QUICKTIME VR"}
"RealAudio" {htmlBuildOpening EMBED 0 0 REALAUDIO}
"No Embed" {htmlBuildCR2Elem NOEMBED}
}
}
"Lists" {
switch $item {
"Make List" {htmlMakeList}
"Bulleted" {htmlBuildList UL "LI IN UL" UL}
"UL no attr" {htmlBuildList UL NOATTR NOATTR}
"New Bulleted Item" {htmlElemListEntry "LI IN UL"}
"Numbered" {htmlBuildList OL "LI IN OL" OL}
"OL no attr" {htmlBuildList OL NOATTR NOATTR}
"New Numbered Item" {htmlElemListEntry "LI IN OL"}
"Directory" {htmlBuildList DIR LI}
"Menu" {htmlBuildList MENU LI}
"New List Item" {htmlElemListEntry LI}
"Discursive" {htmlBuildDiscList}
"New Discursive Entry" {htmlElemDiscEntry}
}
}
"Forms" {
switch $item {
"Form" {htmlBuildCR2Elem FORM}
"Text" {htmlBuildInputElem TEXT}
"Checkbox" {htmlBuildInputElem CHECKBOX}
"Button" {htmlBuildInputElem BUTTON}
"Radio" {htmlBuildInputElem RADIO}
"Submit" {htmlBuildInputElem SUBMIT}
"Reset" {htmlBuildInputElem RESET}
"Password" {htmlBuildInputElem PASSWORD}
"Hidden" {htmlBuildInputElem HIDDEN}
"Image" {htmlBuildInputElem IMAGE}
"File Upload" {htmlBuildInputElem FILE}
"Select" {htmlBuildCR2Elem SELECT}
"Option" {htmlBuildOpening OPTION 1 0}
"Textarea" {htmlBuildCRElem TEXTAREA}
}
}
"Tables" {
switch $item {
"Table Template" {htmlTableTemplate}
"Tabs to Rows" {htmltabsToRows selection}
"Rows to Tabs" {htmlrowsToTabs}
"Import Table" {htmltabsToRows file}
Table {htmlBuildCR2Elem TABLE}
Row {htmlBuildCR2Elem TR}
"TR no attr" {htmlBuildCR2Elem TR NOATTR}
Header {htmlBuildElem TH}
"TH no attr" {htmlBuildElem TH NOATTR}
Cell {htmlBuildElem TD}
"TD no attr" {htmlBuildElem TD NOATTR}
Caption {htmlBuildCRElem CAPTION}
}
}
"Frames" {
switch $item {
"New Doc. with Frames" {htmlNewTemplate FRAMESET}
Frameset {htmlBuildCR2Elem FRAMESET}
Frame {htmlBuildOpening FRAME 0 1}
"No Frames" {htmlBuildCR2Elem NOFRAMES}
}
}
"Image Maps" {
switch $item {
"Convert NCSA Map" {htmlConvertMap NCSA}
"Convert CERN Map" {htmlConvertMap CERN}
Map {htmlBuildCR2Elem MAP}
Area {htmlBuildOpening AREA 0 1}
}
}
"Java" {
switch $item {
Applet {htmlBuildCR2Elem APPLET}
Parameter {htmlBuildOpening PARAM 0 1}
Script {htmlBuildCR2Elem SCRIPT}
"No Script" {htmlBuildCR2Elem NOSCRIPT}
}
}
"Other" {
switch $item {
"Comment" {htmlElemComment}
"Base" {htmlBuildOpening BASE 1 1}
"Isindex" {htmlBuildOpening ISINDEX 1 1}
"Link" {htmlBuildOpening LINK 1 1}
"Meta" {htmlBuildOpening META 1 1}
"Comment Line" {htmlDividingLine}
}
}
"Character Entities" {
switch $item {
"Add" {htmlAddCommonChars}
"Default" {htmlDefaultCommonChars}
"Clear" {htmlClearCommonChars}
default {htmlInsertCharacter $item}
}
}
"Small Chars" {
switch $item {
default {htmlInsertCharacter $item}
}
}
"Capital Chars" {
switch $item {
default {htmlInsertCharacter $item}
}
}
"Other Chars" {
switch $item {
default {htmlInsertCharacter $item}
}
}
"Custom" {
catch {eval $htmlElemProc([string toupper $item])}
}
}
}
#
# The menu.
#
# This is built up with lappends because I want parts of it to be
# dynamic, to depend on which elements have attributes defined on
# them.
#
# <B = control <I = option <U = shift <O = command <S = dynamical
proc htmlBuildMenu {} {
global htmlCustomMenuList htmlPackageToUse modifiedModeVars
global htmlMenu HTMLmodeVars htmlSpecialCharacter htmlBrowsers
global htmlCapCharSpecMenu htmlSpecialSymbCharacter browserSig
global htmlExtIsLoaded html32IsLoaded htmlElemKeyBinding
global htmlShownWarning htmlElemAttrOptional1 htmlElemAttrOptional3 htmlAdditionExist
set commonChars $HTMLmodeVars(commonChars)
# htmlPackageToUse must be set here. It's used globally in many places.
set htmlPackageToUse $HTMLmodeVars(htmlPackageToUse)
# Check if user used HTML 2.0!
if {[lsearch -exact {1 3} $htmlPackageToUse] < 0} {
set htmlPackageToUse 3
set HTMLmodeVars(htmlPackageToUse) 3
lappend modifiedModeVars {htmlPackageToUse HTMLmodeVars}
}
if {$htmlPackageToUse == 1} {
if {!$htmlExtIsLoaded} {
htmlExtensions
set htmlExtIsLoaded 1
rename htmlExtensions ""
}
} else {
if {!$html32IsLoaded} {
html32
set html32IsLoaded 1
rename html32 ""
}
}
# start empty
set htmlMenuList {}
# Browsers
set htmlBrowserMenu [list menu -M HTML -p htmlMenuItem -m -n Browsers \
[list "<S<O<U/SSend File to Browser" "(-" "Add…" "Remove…" "(-"]]
lappend htmlMenuList $htmlBrowserMenu "<SManual" "<SHelp"
# Temporarily keep palette.
if {[regexp {[0-9]+.[0-9]+} [lindex [version] 2] vrs] && $vrs < 6.51} {
lappend htmlMenuList "Palette"
}
# Packages
set htmlPackagesMenu [list menu -M HTML -p htmlMenuItem -m -n Packages \
[list "HTML 3.2" "Extensions" ]]
lappend htmlMenuList $htmlPackagesMenu
#===============================================================================
# Utilities
#===============================================================================
# Editing
set htmlEditMenu [list menu -M HTML -p htmlMenuItem -m -n "Editing" \
[list "<S<O/BSelect Container" "<S<O<I/BSelect Opening" \
"<O<U/BSelect in Container" \
"<S<B/eUntag" "<S<B<I/eUntag and Select" "<B/fRemove Opening" \
"<S<B/gChange Container" "<S<B<I/gChange Opening" "<B/hChange Choice" \
"<B/iReveal Color" "<O/cRemove Marks"]]
lappend tmpMenuList $htmlEditMenu
# Character conversion
set htmlConvertMenu [list menu -M HTML -p htmlMenuItem -m -n "Character Translation" \
[list "åäö -> HTML" "HTML -> åäö"]]
lappend tmpMenuList $htmlConvertMenu
# URLs
set htmlURLsMenu [list menu -M HTML -p htmlMenuItem -m -n "URLs" [list "Clean Up…" \
"Clear" "Import…" "Export…" "Add Folder…" "Add Selection" "Add Clipboard"]]
lappend tmpMenuList $htmlURLsMenu
# Windows
set htmlWinMenu [list menu -M HTML -p htmlMenuItem -m -n "Windows" [list \
"Clean Up…" "Clear"]]
lappend tmpMenuList $htmlWinMenu
# Check links
set htmlCheckLinkMenu [list menu -M HTML -p htmlMenuItem -m -n "Check Links" \
[list "Check Window" "Check Home Page" "Check Folder" "Check File" "(-" "Use Big Brother"]]
lappend tmpMenuList $htmlCheckLinkMenu
#Includes
set htmlIncludeMenu [list menu -M HTML -p htmlMenuItem -m -n "Includes" \
[list "Insert Include Tags…" "(-" "Update Window" "Update Home Page" "Update Folder" "Update File"]]
lappend tmpMenuList $htmlIncludeMenu
# Extending HTML mode.
if {$htmlPackageToUse == 1} {
set htmlExtendMenu [list menu -M HTML -p htmlMenuItem -m -n "Extend" \
[list "New Element" "New Attributes" "New Choices" "Change Key Binding" \
"Change Type and Layout" "Remove Attributes" "Remove Additions"]]
lappend tmpMenuList $htmlExtendMenu
}
set htmlUtilitiesMenu [list menu -M HTML -p htmlMenuItem -m \
-n "HTML Utilities" [concat [list "Colors…" "Home Pages…" "Footers…" "(-"] \
$tmpMenuList [list "(-" "Move Files…" "(-" "Last Modified…"]]]
lappend htmlMenuList $htmlUtilitiesMenu
# Use Attributes
# Dynamically-built list of elements whose default attributes can be selected
foreach a [array names htmlElemAttrOptional$htmlPackageToUse] {
if {[llength [set htmlElemAttrOptional${htmlPackageToUse}($a)]]} {lappend htmlPossibleToUse $a}
}
set htmlUseAttrsMenu [list menu -M HTML -p htmlMenuItem -m -n "Use Attributes" \
[lsort $htmlPossibleToUse]]
lappend htmlMenuList $htmlUseAttrsMenu
# New document
lappend htmlMenuList "(-" "<B<U<I/DNew Document"
# Header1, Header2...
set htmlHeadersMenu [list menu -M HTML -p htmlMenuItem -m -n Headers \
[list "<S<B<O/1Header1" "<S<B<I<O/1H1 no attr" \
"<S<B<O/2Header2" "<S<B<I<O/2H2 no attr" \
"<S<B<O/3Header3" "<S<B<I<O/3H3 no attr"\
"<S<B<O/4Header4" "<S<B<I<O/4H4 no attr"\
"<S<B<O/5Header5" "<S<B<I<O/5H5 no attr" \
"<S<B<O/6Header6" "<S<B<I<O/6H6 no attr"]]
lappend htmlMenuList $htmlHeadersMenu
# Blocks and Dividers
if {$htmlPackageToUse == 1} {
set htmlBlocksMenu [list menu -M HTML -p htmlMenuItem -m -n "Blocks and Dividers" \
[list "<E<SRemove Line Breaks" "<SInsert Line Breaks" \
"Insert Paragraphs" "(-" \
"<S<U/bParagraph" "<S<U<I/bP no attr" \
"<E<S<U<O/bDivision" "<S<U<I<O/bDIV no attr" \
"<B<O/QBlock Quote" "<B<O/SAddress" \
"<B<O/CCenter" "<B<O/PPreformatted" "<B<O/XMulti Column" "<B<O/ZSpacing" \
"(-" "<S<O/bLine Break" "<S<I<O/bBR no attr" \
"<S<B<O/HHorizontal Rule" "<S<B<I<O/HHR no attr" \
"<B<O/BNo Line Break" "<B<O/WWord Break"]]
} else {
set htmlBlocksMenu [list menu -M HTML -p htmlMenuItem -m -n "Blocks and Dividers" \
[list "<E<SRemove Line Breaks" "<SInsert Line Breaks" \
"Insert Paragraphs" "(-" \
"<S<U/bParagraph" "<S<U<I/bP no attr" \
"<E<S<U<O/bDivision" "<S<U<I<O/bDIV no attr" \
"<B<O/QBlock Quote" "<B<O/SAddress" \
"<B<O/CCenter" "<B<O/PPreformatted" \
"(-" "<S<O/bLine Break" "<S<I<O/bBR no attr" \
"<S<B<O/HHorizontal Rule" "<S<B<I<O/HHR no attr"]]
}
lappend htmlMenuList $htmlBlocksMenu
# Styles
if {$htmlPackageToUse ==1} {
set htmlStylesMenu [list menu -M HTML -p htmlMenuItem -m -n Styles \
[list "<B<I/FFont" "<B<I/NBasefont" "(-" "<B<I/BBold" "<B<I/IItalic" \
"<B<I/-Strike out" "<B<I<O/-Underlined" "<B<I/.Superscript" "<B<I/,Subscript"\
"<O<B<I/.Bigger" "<O<B<I/,Smaller" "<B<I/TTypewriter" "<B<I/ZBlinking" \
"(-" "<B<I/EEmphasis" "<B<I/SStrong" \
"<B<I/DDefinition" "<B<I/CCode" "<B<I/VVariable" \
"<B<I/XCitation" "<B<I/KKeyboard" \
"<B<I/PSample"]]
} else {
set htmlStylesMenu [list menu -M HTML -p htmlMenuItem -m -n Styles \
[list "<B<I/FFont" "<B<I/NBasefont" "(-" "<B<I/BBold" "<B<I/IItalic" \
"<B<I/-Strike out" "<B<I<O/-Underlined" "<B<I/.Superscript" "<B<I/,Subscript"\
"<O<B<I/.Bigger" "<O<B<I/,Smaller" "<B<I/TTypewriter" "(-" "<B<I/EEmphasis"\
"<B<I/SStrong" "<B<I/DDefinition" "<B<I/CCode" "<B<I/VVariable" \
"<B<I/XCitation" "<B<I/KKeyboard" \
"<B<I/PSample" ]]
}
lappend htmlMenuList $htmlStylesMenu
# Links
set htmlLinksMenu [list menu -M HTML -p htmlMenuItem -m -n Links \
[list "<B<O/ALink or Anchor" \
"<B<O/IImage" ]]
lappend htmlMenuList $htmlLinksMenu
# Plug-ins
if {$htmlPackageToUse == 1} {
set htmlPluginMenu [list menu -M HTML -p htmlMenuItem -m -n Plug-ins \
[list "<B<O/EGeneral" "LiveAudio" "LiveVideo" "QuickTime Movie" \
"QuickTime VR" "RealAudio" (- "<B<O/NNo Embed"]]
lappend htmlMenuList $htmlPluginMenu
}
# Lists
set htmlListsMenu [list menu -M HTML -p htmlMenuItem -m -n Lists \
[list "Make List" "(-" "<S<B<O/UBulleted" "<S<B<I<O/UUL no attr" \
"<B<I/UNew Bulleted Item" "<S<B<O/ONumbered" "<S<B<I<O/OOL no attr"\
"<B<I/ONew Numbered Item" "<B<O/DDirectory" \
"<B<O/MMenu" "<B<I/LNew List Item" "(-" \
"<U<B<O/DDiscursive" "<B<I<O/LNew Discursive Entry"]]
lappend htmlMenuList $htmlListsMenu
# Forms
if {$htmlPackageToUse == 1} {
set htmlFormsMenu [list menu -M HTML -p htmlMenuItem -m -n Forms \
[list "<B<U/FForm" "(-" "<B<U/TText" "<B<U/BCheckbox" "<B<U/NButton" \
"<B<U/RRadio" "<B<U/SSubmit" \
"<B<U/CReset" "<B<U/PPassword" "<B<U/HHidden" "<B<U/IImage" "<B<U/UFile Upload" \
"(-" "<B<I<U/SSelect" "<B<U/OOption" "<B<U<I/TTextarea"]]
} else {
set htmlFormsMenu [list menu -M HTML -p htmlMenuItem -m -n Forms \
[list "<B<U/FForm" "(-" "<B<U/TText" "<B<U/BCheckbox" \
"<B<U/RRadio" "<B<U/SSubmit" \
"<B<U/CReset" "<B<U/PPassword" "<B<U/HHidden" "<B<U/IImage" "<B<U/UFile Upload" \
"(-" "<B<I<U/SSelect" "<B<U/OOption" "<B<U<I/TTextarea"]]
}
lappend htmlMenuList $htmlFormsMenu
# Tables
set htmlTablesMenu [list menu -M HTML -p htmlMenuItem -m -n Tables \
[list "Table Template…" "<E<SRows to Tabs" "<STabs to Rows" "Import Table…" "(-" \
"<U<O/TTable" "<S<U<O/RRow" "<S<U<I<O/RTR no attr" \
"<S<U<O/HHeader" "<S<U<I<O/HTH no attr" \
"<S<U<O/DCell" "<S<U<I<O/DTD no attr" "<U<O/CCaption"]]
lappend htmlMenuList $htmlTablesMenu
# Frames
if {$htmlPackageToUse == 1} {
set htmlFramesMenu [list menu -M HTML -p htmlMenuItem -m -n Frames \
[list "<B<U<I/FNew Doc. with Frames" "<B<U<I/OFrameset" \
"<B<U<I/RFrame" "<B<U<I/NNo Frames"]]
lappend htmlMenuList $htmlFramesMenu
}
# Client-side image maps
set htmlImageMenu [list menu -M HTML -p htmlMenuItem -m -n "Image Maps" \
[list "Convert NCSA Map…" "Convert CERN Map…" "(- " "<B<U/MMap" "<B<U/AArea"]]
lappend htmlMenuList $htmlImageMenu
# Java
if {$htmlPackageToUse == 1} {
set htmlJavaMenu [list menu -M HTML -p htmlMenuItem -m -n "Java" \
[list "<U<I<O/JApplet" "<U<I<O/PParameter" "<U<I<O/SScript" "<U<I<O/NNo Script"]]
lappend htmlMenuList $htmlJavaMenu
} else {
set htmlJavaMenu [list menu -M HTML -p htmlMenuItem -m -n "Java" \
[list "<U<I<O/JApplet" "<U<I<O/PParameter"]]
lappend htmlMenuList $htmlJavaMenu
}
# Other stuff, miscellaneous
set htmlOtherMenu [list menu -M HTML -p htmlMenuItem -m -n "Other" \
[list "<B<U<I/CComment" \
"<B<U<I/BBase" "<B<U<I/IIsindex" "<B<U<I/LLink" "<B<U<I/MMeta" \
"Comment Line"]]
lappend htmlMenuList $htmlOtherMenu
# Allow user to insert custom menu items
if {$htmlPackageToUse == 1 && [info exists htmlElemKeyBinding]} {
foreach elem [lsort [array names htmlElemKeyBinding]] {
lappend customMenuList "$htmlElemKeyBinding($elem)[string range $elem 0 0][string tolower [string range $elem 1 end]]"
}
set htmlCustomMenu [list menu -M HTML -p htmlMenuItem -m -n "Custom" $customMenuList]
lappend htmlMenuList $htmlCustomMenu
}
# Show alert if user uses old way of defining custom elements.
if {[info exists htmlCustomMenuList]} {htmlNewElemVar}
# Character entities
set htmlSmallCharsMenu [list menu -M HTML -p htmlMenuItem -m -n "Small Chars" \
[lsort [array names htmlSpecialCharacter]]]
set htmlCapCharsMenu [list menu -M HTML -p htmlMenuItem -m -c -n "Capital Chars" \
[lsort [array names htmlCapCharSpecMenu]]]
set htmlSymbCharsMenu [list menu -M HTML -p htmlMenuItem -m -n "Other Chars" \
[lsort [array names htmlSpecialSymbCharacter]]]
set tmp $commonChars
if {[llength $commonChars]} {lappend tmp "(-"}
lappend tmp Add Default Clear $htmlSmallCharsMenu $htmlCapCharsMenu $htmlSymbCharsMenu
set htmlCharsMenu [list menu -M HTML -p htmlMenuItem -m -n "Character Entities" $tmp]
lappend htmlMenuList $htmlCharsMenu
# Put it all together
menu -M HTML -m -p htmlMenuItem -n $htmlMenu $htmlMenuList
insertMenu $htmlMenu
# Add some things to translation menu.
addMenuItem -m -l "" "Character Translation" "<>& -> HTML"
addMenuItem -m -l "" "Character Translation" "HTML -> <>&"
# Mark package
if {$htmlPackageToUse == 1} {
markMenuItem -m {Packages} {Extensions} 1
} else {
markMenuItem -m {Packages} {HTML 3.2} 1
}
# Disable Extend menu if not cleaned up HTMLAdditions.tcl
if {[info exists htmlShownWarning]} {enableMenuItem "HTML Utilities" Extend off}
# Disable Use Attrs menu if status bar isn't used.
if {$HTMLmodeVars(useBigWindows)} {
enableMenuItem $htmlMenu "Use Attributes" off
}
# Disable URLs and Windows menus if caches are empty.
if {![llength $HTMLmodeVars(URLs)]} {htmlEnableURLs off}
if {![llength $HTMLmodeVars(windows)]} {htmlEnablewindows off}
# Disable some menu items in Extend menu if no additions.
if {$htmlPackageToUse == 1} {htmlEnableExtend [info exists htmlElemKeyBinding] $htmlAdditionExist}
# Check if Big Brother exists and if it should be used.
if {[catch {nameFromAppl Bbth}]} {
enableMenuItem "Check Links" "Use Big Brother" off
if {$HTMLmodeVars(useBigBrother)} {
set HTMLmodeVars(useBigBrother) 0
lappend modifiedModeVars {useBigBrother HTMLmodeVars}
}
} elseif {$HTMLmodeVars(useBigBrother)} {
markMenuItem -m {Check Links} {Use Big Brother} 1
}
# Add browsers to Browser menu
if {[lsearch -exact $HTMLmodeVars(browsers) $browserSig] < 0} {
lappend HTMLmodeVars(browsers) $browserSig
lappend modifiedModeVars {browsers HTMLmodeVars}
}
set htmlBrowsers {}
set tmpbrws {}
foreach brws $HTMLmodeVars(browsers) {
if {![catch {nameFromAppl $brws} name]} {
set name [file tail $name]
lappend htmlBrowsers [list $brws $name]
lappend tmpbrws $brws
addMenuItem -m "Browsers" $name
if {$brws == $browserSig} {markMenuItem -m "Browsers" $name on }
} else {
lappend modifiedModeVars {browsers HTMLmodeVars}
}
}
set HTMLmodeVars(browsers) $tmpbrws
}
#===============================================================================
# Key Bindings
#===============================================================================
proc htmlBindKeys {} {
global HTMLmodeVars
catch {deleteModeBindings HTML}
# tabs to tabmarks (•)
bind '\t' htmlTabNext HTML
bind '\t' <s> htmlTabPrev HTML
bind ',' <zso> {htmlInsertCharacter "less than"} HTML
bind '.' <zso> {htmlInsertCharacter "greater than"} HTML
bind '7' <zso> {htmlInsertCharacter ampersand} HTML
bind 0x31 <zso> {htmlInsertCharacter "nonbreak space"} HTML
# bindings for JavaScript
bind '\{' <s> electricLeft HTML
bind '\}' <s> electricRight HTML
# Comment line
bind 'l' <C> htmlDividingLine HTML
}
# Unbinding of keys not used in the smaller packages.
proc htmlUnbindKeys {} {
global htmlPackageToUse htmlElemKeyBinding
if {$htmlPackageToUse == 3} {
unbind 'f' <zso> {} HTML
unbind 'o' <zso> {} HTML
unbind 'r' <zso> {} HTML
unbind 'n' <zso> {} HTML
unbind 'e' <zc> {} HTML
unbind 'n' <zc> {} HTML
foreach elem [array names htmlElemKeyBinding] {
set keystr $htmlElemKeyBinding($elem)
if {[string length $keystr]} {
set key [string tolower [string range $keystr [expr [string length $keystr] - 1] end]]
set mods ""
foreach m [split [string range $keystr 1 [expr [string length $keystr] - 3]] < ] {
if {$m == "B"} {append mods z}
if {$m == "I"} {append mods o}
if {$m == "U"} {append mods s}
if {$m == "O"} {append mods c}
}
catch {unbind '$key' <$mods> {} HTML}
}
}
}
}